package com.example.pgtest.controller;

import com.alibaba.fastjson.JSON;
import com.example.pgtest.entity.NodeInfo;
import com.example.pgtest.entity.User;
import com.example.pgtest.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.sql.SQLException;
import java.util.List;


/**
 * @author WDK
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("info")
    public List<NodeInfo> updateUser(User user){
        List<NodeInfo> nodeInfos = userService.selectInfo(user.getMethod());
        System.out.println(JSON.toJSONString(nodeInfos));
        return nodeInfos;
    }
}
